﻿using Domain.Entitys.Sinv;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.EntityConfigurations.Sinv
{
    public class Sinv_Sale_OutboundConfiguration : IEntityTypeConfiguration<Sinv_Sale_Outbound_Details>
    {
        public void Configure(EntityTypeBuilder<Sinv_Sale_Outbound_Details> builder)
        {
            builder.ToTable("sinv_sale_outbound_details");
            builder.HasKey(sod => sod.Sale_outbound_details_id);

            builder.HasOne(sod => sod.Main)
                .WithMany(sod => sod.Details)
                .HasForeignKey(sod => sod.Sale_outbound_id);
        }
    }
}
